package com.itheima.d4_algorithm;

import java.util.Arrays;

/**
 * 目标：掌握二分查找算法。
 *
 * binarySearch
 */
public class Test3 {
    public static void main(String[] args) {
        int []arr={1,5,6,2,3};

        Arrays.sort(arr);
        System.out.println(Arrays.toString(arr));
        int index = Arrays.binarySearch(arr, 6);

        System.out.println(index);
    }
}
